From 2e4f771f0c39efbddf0756932a68b23142e43f5e Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sun, 30 Oct 2005 16:43:05 +0100 Subject: [PATCH] Once grant refs run out, netfront prints a nice message, but doesn't set err properly to notify the caller, and the domU crashes. (See bug 183 for details). Signed-off-by: Jim Dykman --- linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 1b43e5ed38..c5f1d5448e 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -877,6 +877,7 @@ static int create_netdev(int handle, struct xenbus_device *dev, if (gnttab_alloc_grant_references(NETIF_TX_RING_SIZE, &np->gref_tx_head) < 0) { printk(KERN_ALERT "#### netfront can't alloc tx grant refs\n"); + err = -ENOMEM; goto exit; } /* A grant for every rx ring slot */ @@ -884,6 +885,7 @@ static int create_netdev(int handle, struct xenbus_device *dev, &np->gref_rx_head) < 0) { printk(KERN_ALERT "#### netfront can't alloc rx grant refs\n"); gnttab_free_grant_references(np->gref_tx_head); + err = -ENOMEM; goto exit; } -- 2.30.2